package com.earnings.okhttputils.utils.ui.fragment.transaction;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.earnings.R;
import com.earnings.okhttputils.utils.ui.BaseFragment;
import com.earnings.okhttputils.utils.ui.activity.user.UserBalanceRechargeActivity;
import com.earnings.okhttputils.utils.utils.CommonUtil;


/**
 * 线下充值-步骤2
 * Created by HOHO on 2017/4/11.
 */

public class RechargeOfflineStepSecondFragment extends BaseFragment {

private EditText money;


    @Override
    protected int onCreateLayout() {
        return  R.layout.fragment_recharge_offline_step2;
    }

    @Override
    protected void init() {
        mView.findViewById(R.id.sumbit).setOnClickListener(this);
        money= (EditText) mView.findViewById(R.id.money);
        ((TextView)mView.findViewById( R.id.accountBanknum)).setText(CommonUtil.getUser().getPhone());

    }


    @Override
    public void onClick(View v) {

        int i = v.getId();
        if (i == R.id.sumbit) {
            String phone =((TextView)mView.findViewById( R.id.accountBanknum)).getText().toString();
            if(phone.length()!=11){showToast("请输入您要充值的账号");return;}
            if(money.getText().length()==0){
                showToast( "请填写您的充值金额" );
                return;}
            ((RechargeOfflineFragment) getActivity().getSupportFragmentManager().getFragments().get( 1 )).imgUpload( money.getText().toString() ,phone);

        }
    }





}
